function addressbook_entry_delete(id){
	if(confirm('Are you sure you want to delete this subscriber?')){
		$.getJSON('addressbook-ajax.php?action=delete_addressbook_entry&id='+id,function(){
			$('#addressbook_entry_'+id)
				.fadeOut('slow',function(){
					$(this).remove();
				});
		});
	}
}
function addressbook_entry_form(){
	hide_addressbook_entry_form();
	$.get('addressbook-ajax.php?action=get_addressbook_entry_form',function(html){
		$(html)
			.css({'display':'none'})
			.insertAfter($('#submenu'))
			.show('slow');
	});
}
function hide_addressbook_entry_form(refresh){
	$('#addressbook_entry_form').hide('slow',function(){
		$('#addressbook_entry_form').remove();
		if(refresh)history.go(0);
	});
}
$(document).ready(function(){
	$('#addressbook_entries .name,#addressbook_entries .address,#addressbook_entries .notes')
		.click(inline_editing_edit);
	inline_editing_url='addressbook-ajax.php?action=edit_addressbook_entry_field';
});
